<h3 class="buildgroupname">
  <a href="#" class="grouptrigger"
     ng-click="jumpToAnchor(buildgroup.linkname)">
    {{::buildgroup.name}}
  </a>
  <span class="buildnums" align="right">{{::buildgroup.numbuildslabel}}</span>
  <a class="grouplink"
     ng-href="viewBuildGroup.php?project={{::cdash.projectname_encoded}}&buildgroup={{::buildgroup.linkname}}&date={{::cdash.date}}&{{::cdash.filterurl}}">[view timeline]</a>
</h3>
<table border="0" cellpadding="4" cellspacing="0" width="100%" class="tabb" id="project_{{::cdash.projectid}}_{{::buildgroup.id}}">
  <thead>
    <tr class="table-heading1" >
      <td colspan="2" class="nob"></td>
      <td ng-if="::buildgroup.hasupdatedata" colspan="{{::1 + cdash.showtimecolumns}}" class="center-text botl">Update</td>
      <td ng-if="::buildgroup.hasconfiguredata" colspan="{{::2 + cdash.showtimecolumns}}" class="center-text botl">Configure</td>
      <td ng-if="::buildgroup.hascompilationdata" colspan="{{::2 + cdash.showtimecolumns}}" class="center-text botl">Build</td>
      <td ng-if="::buildgroup.hastestdata" colspan="{{::3 + cdash.extratestcolumns}}" class="center-text botl">Test</td>
      <td align="right" class="nob" colspan="{{::cdash.numcolumns}}"></td>
    </tr>

    <tr class="table-heading">

      <th ng-if="::cdash.childview == 1"
          ng-click="updateOrderByFields(buildgroup, 'label', $event)"
          colspan="2" rowspan="2" class="column-header">
        SubProject
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-label') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('label') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::cdash.childview != 1"
          ng-click="updateOrderByFields(buildgroup, 'site', $event)"
          rowspan="2" class="column-header">
        Site
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-site') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('site') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::cdash.childview != 1"
          ng-click="updateOrderByFields(buildgroup, 'buildname', $event)"
          rowspan="2" class="column-header">
        Build Name
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-buildname') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('buildname') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>
    </tr>

    <tr class="table-heading">
      <th ng-if="::buildgroup.hasupdatedata"
          ng-click="updateOrderByFields(buildgroup, 'update.files', $event)"
          class="column-header">
        {{::cdash.updatetype}}
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-update.files') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('update.files') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hasupdatedata && cdash.advancedview != 0 && cdash.showstarttime"
          ng-click="updateOrderByFields(buildgroup, 'update.timefull', $event)"
          class="column-header">
        Time
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-update.timefull') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('update.timefull') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hasconfiguredata"
          ng-click="updateOrderByFields(buildgroup, 'configure.error', $event)"
          class="column-header">
        Error
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-configure.error') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('configure.error') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hasconfiguredata"
          ng-click="updateOrderByFields(buildgroup, 'configure.warning', $event)"
          class="column-header">
        Warn
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-configure.warning') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('configure.warning') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hasconfiguredata && cdash.advancedview != 0 && cdash.showstarttime"
          ng-click="updateOrderByFields(buildgroup, 'configure.timefull', $event)"
          class="column-header">
        Time
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-configure.timefull') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('configure.timefull') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hascompilationdata"
          ng-click="updateOrderByFields(buildgroup, 'compilation.error', $event)"
          class="column-header">
        Error
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-compilation.error') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('compilation.error') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hascompilationdata"
          ng-click="updateOrderByFields(buildgroup, 'compilation.warning', $event)"
          class="column-header">
        Warn
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-compilation.warning') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('compilation.warning') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hascompilationdata && cdash.advancedview != 0 && cdash.showstarttime"
          ng-click="updateOrderByFields(buildgroup, 'compilation.timefull', $event)"
          class="column-header">
        Time
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-compilation.timefull') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('compilation.timefull') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hastestdata"
          ng-click="updateOrderByFields(buildgroup, 'test.notrun', $event)"
          class="column-header">
        Not Run
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-test.notrun') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('test.notrun') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hastestdata"
          ng-click="updateOrderByFields(buildgroup, 'test.fail', $event)"
          class="column-header">
        Fail
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-test.fail') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('test.fail') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hastestdata"
          ng-click="updateOrderByFields(buildgroup, 'test.pass', $event)"
          class="column-header">
        Pass
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-test.pass') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('test.pass') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hastestdata && cdash.showtesttime"
          ng-click="updateOrderByFields(buildgroup, 'test.timefull', $event)"
          class="column-header">
        Time
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-test.timefull') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('test.timefull') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::buildgroup.hastestdata && cdash.advancedview != 0 && cdash.showProcTime"
          ng-click="updateOrderByFields(buildgroup, 'test.procTimeFull', $event)"
          class="column-header">
        Proc Time
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-test.procTimeFull') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('test.procTimeFull') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::cdash.showstarttime"
          ng-click="updateOrderByFields(buildgroup, 'builddatefull', $event)"
          class="column-header">
        Start Time
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-builddatefull') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('builddatefull') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::cdash.showorder"
          ng-click="updateOrderByFields(buildgroup, 'position', $event)"
          class="column-header">
        Order
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-position') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('position') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>

      <th ng-if="::cdash.childview != 1 && cdash.displaylabels == 1"
          ng-click="updateOrderByFields(buildgroup, 'label', $event)"
          rowspan="2" class="column-header nob">
        Labels
        <span class="glyphicon" ng-class="buildgroup.orderByFields.indexOf('-label') != -1 ? 'glyphicon-chevron-down' : (buildgroup.orderByFields.indexOf('label') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')"></span>
      </th>
   </tr>
  </thead>

  <tbody>
    <tr ng-repeat="build in buildgroup.pagination.filteredBuilds"
        ng-class-odd="'odd'" ng-class-even="'even'"
        build
        valign="middle">
    </tr>
  </tbody>
</table>

<div ng-if="buildgroup.builds.length > buildgroup.pagination.numPerPage && buildgroup.pagination.numPerPage != -1">
  <uib-pagination
    ng-model="buildgroup.pagination.currentPage"
    total-items="buildgroup.builds.length"
    max-size="buildgroup.pagination.maxSize"
    items-per-page="buildgroup.pagination.numPerPage"
    ng-change="pageChanged(buildgroup)"
    boundary-links="true">
  </uib-pagination>
</div>

<div ng-if="::buildgroup.builds.length > 10">
  <label>Items per page</label>
  <select ng-model="buildgroup.pagination.numPerPage" convert-to-number ng-change="numBuildsPerPageChanged(buildgroup)">
    <option value="10">10</option>
    <option value="25">25</option>
    <option value="50">50</option>
    <option value="100">100</option>
    <option value="-1">All</option>
  </select>
  <br/>
  <br/>
</div>
